<template>
    <div class="vpubsub-son2">
        <el-button @click="sendMsg" style="marginTop: 10px;">点击发布消息（发送数据）</el-button>
    </div>
</template>

<script>
import pubsub from 'pubsub-js';

export default {
    name: 'VpubsubSon2',
    methods: {
        sendMsg() {
            pubsub.publish('msgName', 'hello,我现在用msgName为消息名，我发布了该数据~');
        }
    }
}
</script>

<style>

</style>